import request from '@/utils/request'

// 精选题库列表
export function getQuestionBankListApi(pagesize, page, data) {
  return request({
    url: `/questions/choice`,
    method: 'get',
    params: {
      pagesize,
      page,
      ...data
    }
  })
}

// 精选题库列表删除
export function delQuestionBankListApi(id) {
  return request({
    url: `/questions/${id}`,
    method: 'DELETE'
  })
}

// 精选题库上架下架
export function addreduceQuestionApi(id, publishState) {
  return request({
    url: `/questions/choice/${id}/${publishState}`,
    method: 'post'
  })
}

// 精选题库以发布已拒绝
export function publishQuestionApi(id, choiceState) {
  return request({
    url: `/questions/choice/${id}/${choiceState}`,
    method: 'PATCH'
  })
}

// 精选题库详情
export function QuestionDetailApi(id) {
  return request({
    url: `/questions/${id}`,
    method: 'get'
  })
}

// 精选题库审核
export function questionAduitApi(id, chkState, chkRemarks) {
  return request({
    url: `/questions/check/${id}`,
    method: 'post',
    data: {
      id,
      chkState,
      chkRemarks
    }
  })
}

// 学科
export function listApi() {
  return request({
    url: '/questions/choice',
    method: 'get'
  })
}
